var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.eRedDotType = undefined;
var $2EventCenter = require("EventCenter");
var $2EventDefine = require("EventDefine");
var $2RedDotManager = require("RedDotManager");
var $2ComWobble = require("ComWobble");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var ccp_menu = cc__decorator.menu;
var h;
(function (e) {
  e[e.Collection = 0] = "Collection";
  e[e.Desktop = 1] = "Desktop";
  e[e.Sidebar = 2] = "Sidebar";
})(h = exports.eRedDotType || (exports.eRedDotType = {}));
var def_RedDotReceiving = /* */function (_cc$Component23) {
  function _ctor() {
    var _this79;
    babel_classCallCheck(this, _ctor);
    _this79 = _callSuper(this, _ctor, arguments);
    _this79.redDotType = h.Collection;
    return _this79;
  }
  babel_inherits(_ctor, _cc$Component23);
  return babel_createClass(_ctor, [{
    key: "onLoad",
    value: function onLoad() {
      $2EventCenter.default.regisEvent($2EventDefine.default.GAME_RED_DOT_NOTIFY, this.notifyRedDot, this);
      $2RedDotManager.default.Instance.syncRedDotStateByType(this.redDotType);
    }
  }, {
    key: "onDestroy",
    value: function onDestroy() {
      $2EventCenter.default.removeEvent($2EventDefine.default.GAME_RED_DOT_NOTIFY, this.notifyRedDot, this);
    }
  }, {
    key: "notifyRedDot",
    value: function notifyRedDot(e) {
      if (e) {
        this.redDotType === e.type && (this.node.active = e.display);
        this.redDotType === h.Sidebar && this.node.parent.getComponent($2ComWobble.default) && (this.node.parent.getComponent($2ComWobble.default).enabled = e.display);
      }
    }
  }]);
}(cc.Component);
cc__decorate([ccp_property({
  type: cc.Enum(h)
})], def_RedDotReceiving.prototype, "redDotType", undefined);
def_RedDotReceiving = cc__decorate([ccp_ccclass, ccp_menu("v-lez/RedDotReceiving")], def_RedDotReceiving);
exports.default = def_RedDotReceiving;